package com.ahao.servlet.admin;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Properties;

@WebServlet("/index")
public class AdminServlet extends HttpServlet {

    private static final Properties SYSTEM_INFO = new Properties();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        SYSTEM_INFO.load(AdminServlet.class.getResourceAsStream("/system_info.properties"));
        req.setAttribute("system_info", SYSTEM_INFO);
        req.getRequestDispatcher("/WEB-INF/jsp/admin/admin.jsp").forward(req, resp);
        HashMap<Object, Object> map = new HashMap<>();
        map.put("name", "ahao");
    }

}

